package com.itheima.io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class 文件复制 {
    public static void main(String[] args) throws IOException {
        //创建输入流
        FileInputStream fis = new FileInputStream("D:\\code\\gitee\\springboot\\shop\\src\\main\\resources\\static\\img\\goods1.jpg");
        //创建输出流
        FileOutputStream fos = new FileOutputStream("E:\\IdeaProjects\\JavaSE_Code\\day11_IO流_字节流\\tp.jpg");

        //获取输入流数据,存入输出流对象
        int b;
        do {
            b = fis.read();
            fos.write(b);
        }while (b != -1);

        //关闭流
        fis.close();
        fos.close();
    }
}
